package com.xm.queue.task;

import java.util.Scanner;

/**
 * 测试手工异步任务 test1,test2,
 */
public class TestTask3 {
    public static void main(String[] args) {
        Consumer.init();

        Scanner sc = new Scanner(System.in);
        String name;
        boolean doExit;
        do {
            System.out.println("请输入任务名称：");
            name = sc.nextLine();
            doExit = !"exit".equals(name);
            if(doExit){
                Producer.addTask(new AsyncTask(name));
            }
        } while (doExit);

        System.out.println("已退出循环！");

        TaskUtil.shutDown();
    }
}
